exports.deleteColumn = function(req,res){

    var bodyParams = req.routeInfo.bodyParams;

    //查询该栏目是否有子栏目
    function isUsedSonColumn(cb){

        R.SEND_HTTP(
            req,
            res,
            {
                url    : CORE_APIConfig.coreAPI.cmsColumnSearch.Request_Api_Url + "/cc_fid/" + bodyParams.cc_id,
                method : 'POST',
                data   : {
                    fields : 'cc_id'
                }
            },
            function (data) {
                
                if(data.result.data.length > 0){
                    return RES.errorResponse(res,'抱歉，该菜单中包含子菜单，请先删除子菜单');
                }

                cb();

            }
        );

    }

    //删除菜单
    function deleteColumn(cb){

        R.SEND_HTTP(
            req,
            res,
            {
                url    : CORE_APIConfig.coreAPI.cmsColumnDelete.Request_Api_Url,
                method : 'POST',
                data   : {
                    delete_where  : 'cc_id',
                    cc_id        : bodyParams.cc_id,
                    cc_is_delete : 1
                }
            },
            function (data) {

                cb();

            }
        );

    }

    F.Serial([
        isUsedSonColumn,
        deleteColumn
    ],() => {
        RES.successResponse(res);
    })

}